Skip to content

nodebuilder/header: Validate range bounds and export ErrRangeTooLarge in GetRangeByHeight#5052

Open
neyy91 wants to merge 1 commit into
celestiaorg:mainfrom
neyy91:fix/header-rpc-range-validation
Open

nodebuilder/header: Validate range bounds and export ErrRangeTooLarge in GetRangeByHeight#5052
neyy91 wants to merge 1 commit into
celestiaorg:mainfrom
neyy91:fix/header-rpc-range-validation

Conversation

@neyy91

@neyy91 neyy91 commented Jun 13, 2026

Copy link
Copy Markdown

Overview

Follow-up to #4945, closes #4858.

#4945 added the MaxRangeRequestSize bound to the RPC GetRangeByHeight path, but a few points from the issue's design considerations remained open. This PR:

  • exports ErrRangeTooLarge as a well-known sentinel error so clients can detect the limit and paginate accordingly
  • rejects reversed/empty ranges early at the RPC level with a clear error message, instead of relying on the store's internal invalid range(...) check
  • returns an error instead of panicking when the from header is nil

No behavioral change for valid requests: the limit value and store semantics ([from.Height()+1, to)) are untouched.

…ounds in GetRangeByHeight

Completes the RPC-level range validation started in celestiaorg#4945:
- export ErrRangeTooLarge as a well-known sentinel error so clients
  can detect the limit and paginate
- reject reversed/empty ranges early with a clear error instead of
  relying on the store's internal range check
- reject nil 'from' header instead of panicking

Closes celestiaorg#4858
@neyy91 neyy91 requested a review from a team as a code owner June 13, 2026 01:01
@neyy91 neyy91 requested a review from mcrakhman June 13, 2026 01:01
@github-actions github-actions Bot added the external Issues created by non node team members label Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Issues created by non node team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(header): add max range size check to RPC GetRangeByHeight

1 participant